fix: build better-sqlite3 native addon so backend can start#65
Merged
Conversation
Yarn 4 disables package build scripts by default, so better-sqlite3's
native addon was never compiled. Without better_sqlite3.node the backend's
SQLite database client fails ("Could not locate the bindings file"),
catalog-backend initialization throws, backend.start() never completes, and
every /api/catalog/* route 404s — surfacing as an empty catalog in the UI
(readiness stays 503 "Backend has not started yet").
Opt better-sqlite3 into building via dependenciesMeta so the addon compiles
on install.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Backstage catalog renders empty and every
/api/catalog/*request 404s. Root cause: the backend never finishes starting./.backstage/health/v1/readinessreturns503 "Backend has not started yet"(liveness staysok).Yarn 4 disables package build scripts by default, so
better-sqlite3's native addon (better_sqlite3.node) is never compiled. The in-memory SQLite client then fails withCould not locate the bindings file, catalog-backend init throws,backend.start()hangs, and no plugin routes mount — so the frontend can't fetch entities.Fix
Opt
better-sqlite3into building viadependenciesMetain the rootpackage.json. Onyarn installthe addon compiles (node_modules/better-sqlite3/build/Release/better_sqlite3.node).Verification
After the fix, the backend boots fully:
Plugin initialization complete … 'catalog', DB migration runs,/api/catalog/entitiesreturns 200, and the search collator indexes bothsoftware-catalogand therwdocs.org/ref-annotated entity.🤖 Generated with Claude Code